CREATE TABLE [dbo].[wld_barra_herramientas]
(
[cd_barra_herr] [dbo].[_codigo] NOT NULL,
[nm_programa] [dbo].[_codigo_largo] NOT NULL,
[nm_boton] [dbo].[_codigo_largo] NOT NULL,
[de_ayuda] [dbo].[_nombre] NULL,
[nu_orden] [dbo].[_entero] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[wld_barra_herramientas] ADD CONSTRAINT [PK_wld_barra_herramientas] PRIMARY KEY NONCLUSTERED  ([cd_barra_herr], [nm_programa]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_wld_barra_herramientas] ON [dbo].[wld_barra_herramientas] ([nm_programa]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[wld_barra_herramientas] ADD CONSTRAINT [FK_wld_barra_herramientas_wcd_barra_herramientas] FOREIGN KEY ([cd_barra_herr]) REFERENCES [dbo].[wcd_barra_herramientas] ([cd_barra_herr]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[wld_barra_herramientas] ADD CONSTRAINT [FK_wld_barra_herramientas_wad_programas] FOREIGN KEY ([nm_programa]) REFERENCES [dbo].[wad_programas] ([nm_programa]) ON DELETE CASCADE
GO
EXEC sp_bindefault N'[dbo].[cero]', N'[dbo].[wld_barra_herramientas].[nu_orden]'
GO
